New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(experimental-utils): expose ReferenceTracker.ESM #3532
feat(experimental-utils): expose ReferenceTracker.ESM #3532
Conversation
Nx Cloud ReportCI ran the following commands for commit 7f75521. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch
Sent with 💌 from NxCloud. |
Thanks for the PR, @MageJohn! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
Ah, this might be superseded by DefinitelyTyped/DefinitelyTyped#53803 ? |
@JoshuaKGoldberg nah it won't be because we can't use the That's why we had to go this route of defining our own set of types for the packages :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Codecov Report
@@ Coverage Diff @@
## master #3532 +/- ##
=======================================
Coverage 92.63% 92.63%
=======================================
Files 325 325
Lines 11235 11236 +1
Branches 3168 3168
=======================================
+ Hits 10408 10409 +1
Misses 367 367
Partials 460 460
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Fixes #3527
ReferenceTracker.ESM seems to be undocumented, but it marks a trace map as being an ES module. It is used only once that I can see, here: https://github.com/mysticatea/eslint-utils/blob/c3b1d38328dc3a5278b208a58186a0735315f58f/src/reference-tracker.js#L181
The code only checks if the trace map has they key, and does nothing with it's value. Therefore when adding it to the TraceMapElement type, I opted to type it as always
true
, if it's present. In theory something likeany
orunknown
would work, but that wouldn't convey that it's just a flag; a type ofboolean
might lead to confusion if users think they can do[ReferenceTracker.ESM]: false
and expect it to be disabled.